﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/Admincp.Master" AutoEventWireup="true" CodeBehind="Quanlydsquocgia.aspx.cs" Inherits="Moving03.Administrator.WebForm8" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    CHI TIẾT 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <form id="form1" runat="server">
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <strong>
    <strong style="color: #6666FF">&nbsp; DANH SÁCH QUỐC GIA</strong></strong><br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="Id_MaQGia" DataSourceID="SqlDataSource1" CellPadding="4" 
        ForeColor="#333333" GridLines="None" Width="80%" style="margin:auto" 
        AllowPaging="True" onrowcommand="GridView1_RowCommand" 
        onrowdeleted="GridView1_RowDeleted">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderImageUrl="~/images/edit.gif" />
            <asp:BoundField DataField="Id_MaQGia" HeaderText="Mã Quốc Gia" 
                InsertVisible="False" ReadOnly="True" SortExpression="Id_MaQGia" />
            <asp:BoundField DataField="TenQuocGia" HeaderText="Tên Quốc Gia" 
                SortExpression="TenQuocGia" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:UPSConnectionString %>" 
        DeleteCommand="DELETE FROM [DanhSachQuocGia] WHERE [Id_MaQGia] = @Id_MaQGia" 
        InsertCommand="INSERT INTO [DanhSachQuocGia] ([TenQuocGia]) VALUES (@TenQuocGia)" 
        SelectCommand="SELECT * FROM [DanhSachQuocGia]" 
        UpdateCommand="UPDATE [DanhSachQuocGia] SET [TenQuocGia] = @TenQuocGia WHERE [Id_MaQGia] = @Id_MaQGia">
        <DeleteParameters>
            <asp:Parameter Name="Id_MaQGia" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="TenQuocGia" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="TenQuocGia" Type="String" />
            <asp:Parameter Name="Id_MaQGia" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="Label"></asp:Label>
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <strong>
    <strong style="color: #6666FF">&nbsp; THÊM QUỐC GIA<br />
    </strong>
    </strong>
    <br />
        <div class="khungnho">
            <table style="width: 100%; "0" cellspacing="0" align="center">
            <tr>
                <th bgcolor="#507DD2" colspan="3" style="color: #FFFFFF">
                    <br />
                    &nbsp;&nbsp; THÊM<br />
                </th>
            </tr>
            <tr>
                <td style="width: 243px">
                    &nbsp;</td>
                <td style="width: 27px">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="width: 243px" align="right">
                    Tên Quốc Gia</td>
                <td style="width: 27px">
                    &nbsp;</td>
                <td>
                    &nbsp;<asp:TextBox ID="txtquocgia" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtquocgia" ErrorMessage="Tên không được rỗng" 
                        ForeColor="Red">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 243px">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                        ForeColor="#FF3300" />
                </td>
                <td style="width: 27px">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="width: 243px">
                    &nbsp;</td>
                <td style="width: 27px">
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnthem" runat="server" onclick="btnthem_Click" Text="Thêm" 
                        style="height: 26px" />
                </td>
            </tr>
            <tr>
                <td style="width: 243px">
                    &nbsp;</td>
                <td style="width: 27px">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            </table>
        </div>
    </form>
</asp:Content>
